package org.example.first.Model1;

public class Client {
    public static void main(String[] args) {
        //假设100元的支付金额
        double amount = 100;

        //生成名为customer1的OrdinaryUser
        Customer customer1 = new OrdinaryUser();
        //赋予OrdinaryUser全价的行为
        customer1.setDiscountBehaviour(new FullPrice());
        //打折
        customer1.display(amount);

        //生成名为customer1的GoldCard
        Customer customer2 = new GoldCard();
        //赋予GoldCard八折的行为
        customer2.setDiscountBehaviour(new BaZhe());
        //打折
        customer2.display(amount);

        //生成名为customer1的SilverCard
        Customer customer3 = new SilverCard();
        //赋予SilverCard九折的行为
        customer3.setDiscountBehaviour(new JiuZhe());
        //打折
        customer3.display(amount);
    }
}